package com.example.lifecycle;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import butterknife.BindView;
import butterknife.ButterKnife;


public class LifeCycle extends AppCompatActivity {

    @BindView(R.id.btn1)
    Button btn1;
    @BindView(R.id.btn2)
    Button btn2;

    public static final String TAG = "LifeCycle";
/*
    private void showMsg(String msg){
        Toast.makeText(LifeCycle.this,msg,Toast.LENGTH_SHORT).show();
    }*/

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.d(TAG,"This is onCreate in LifeCycle");
        ButterKnife.bind(this);

        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LifeCycle.this,test2.class);
                startActivity(intent);
            }
        });
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LifeCycle.this,test3.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG,"This is onStart in LifeCycle");
    }

    @Override
    protected void onRestart (){
        super.onRestart();
        Log.d(TAG,"This is onRestart in LifeCycle");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG,"This is onResume in LifeCycle");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG,"This is onPause in LifeCycle");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d(TAG,"This is onStop in LifeCycle");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(TAG,"This is onDestroy in LifeCycle");
    }




}
